<meta http-equiv="content-type" content="text/html;charset=utf-8">
<table border=1 align="center">
	<script type="text/javascript">
		
	</script>
<tr>
	<td>ip</td>
	<td>用户ID</td>
	<td>节目ID</td>
	<td>节目名</td>
	<td>预览</td>
	<td>栏目ID</td>
	<td>开始时间</td>
	<td>结束时间</td>
</tr>
<?php
//phpinfo(); 
//echo  file_get_contents("acess86.log.2013-07-02");
$file = fopen("acess86.log.2013-07-02","r");
while(! feof($file))
  {
  	$a=fgets($file). "<br />";
  	$arr=explode(" ", $a);
  	?>
  	
  		<tr>
  			<td><?php echo $arr[6]?></td>
			<td><?php echo getPars("userid",$arr[8]) ?></td>
			<td><?php echo getPars("contentid",$arr[8]) ?></td>
			<td><?php echo getPars("contentname",$arr[8]) ?></td>
			<td><?php echo getPars("order_save",$arr[8]) ?></td>
			<td><?php echo getPars("cat_code",$arr[8]) ?></td>
			<td><?php echo $arr[9]."<br>".$arr[10] ?></td>
			<td><?php echo $arr[11]."<br>".$arr[12] ?></td>
  		</tr>
  	<?php
  }

fclose($file);

function getPars($paras,$url) {
	   	$paraString = explode("&",substr($url,strpos($url,"?") + 1));
	    $paraObj = array();
	    for ($i = 0; $j = $paraString[$i]; $i++) {
	        $paraObj[strtolower(substr($j,0, strpos($j,"=")))] = substr($j,strpos($j,"=") + 1);		
	    }
	    $returnValue = $paraObj[strtolower($paras)];
	    if (null==$returnValue) {
	        return "";		
	    } else {
	        return $returnValue;
	    }
	}
?>
</table>